Computer virtualization is a technique that involves encapsulating a physical computing machine platform into a virtual machine that is executed under the control of virtualization software on a hardware computing platform, or “host.” A virtual machine (VM) has both virtual system hardware and guest operating system software. Virtual system hardware typically includes at least one “virtual disk,” a single file or a set of files that appear as a typical storage drive to the guest operating system. The virtual disk may be stored on the host platform or on a remote storage device. Typically, a virtual machine uses the virtual disk in the same manner that a physical storage drive is used, to store the guest operating system, application programs, and application data.
A virtual disk is typically organized as a set of logical data blocks that are accessed by a VM via a file descriptor associated with a virtual disk. Multiple VMs may share a data block of the virtual disk, such that multiple file descriptors reference the data block. A shared data block is treated as read-only and marked as “copy-on-write.” Therefore, a write IO transmitted by a VM targeting a shared data block results in the allocation of a new data block. The contents of the entire data block are then copied to the newly allocated data block, and the write IO is performed on the newly allocated data block. Writing to a shared data block adds time and processing overhead as an entire data block must be copied before the write operation can be performed. If multiple VMs share many data blocks of a virtual disk, write operations can become very slow resulting in the degradation of the overall performance of the virtualized environment.
As the foregoing illustrates, what is needed in the art is a mechanism for writing to a shared data block of a virtual disk with minimal impact to performance.